
import model.Game;
import model.Hockeyist;
import model.Move;
import model.World;

public final class MyStrategy implements Strategy {

    @Override
    public void move(Hockeyist self, World world, Game game, Move move) {
//        AbstractStrategy strategy=new Test(self, world, game, move);
        AbstractStrategy strategy;
        if (world.getMyPlayer().isJustMissedGoal() || world.getMyPlayer().isJustScoredGoal()) {
            strategy = new Holyday(self, world, game, move);
        } else        if (world.getPuck().getOwnerPlayerId() == -1) {
            strategy = new PickUp(self, world, game, move);
        } else if (world.getPuck().getOwnerPlayerId() == self.getPlayerId()) {
            strategy = new Attack(self, world, game, move);
        } else {
            strategy = new Defend(self, world, game, move);
        }
        strategy.run();
    }
}
